using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using WalkingTec.Mvvm.Core;

namespace HengTong.Model.Db.Hr.Attendance
{
    /// <summary>
    /// 人员和考勤关系表，记录员工与考勤规则的关联关系
    /// </summary>
    public class SysPersonAttendance : TopBasePoco
    {
        /// <summary>
        /// 获取或设置人员ID
        /// </summary>
        /// <value>关联的人员ID</value>
        [Display(Name = "人员", Description = "关联的人员", GroupName = "基本信息")]
        [Required(ErrorMessage = "人员不能为空")]
        public Guid? PersonId { get; set; }

        /// <summary>
        /// 获取或设置人员导航属性
        /// </summary>
        /// <value>关联的人员实体</value>
        public SysPerson Person { get; set; }

        /// <summary>
        /// 获取或设置考勤规则ID
        /// </summary>
        /// <value>关联的考勤规则ID</value>
        [Display(Name = "考勤规则", Description = "关联的考勤规则", GroupName = "基本信息")]
        [Required(ErrorMessage = "考勤规则不能为空")]
        public Guid? AttendanceRuleId { get; set; }

        /// <summary>
        /// 获取或设置考勤规则导航属性
        /// </summary>
        /// <value>关联的考勤规则实体</value>
        public SysAttendanceShift AttendanceShift { get; set; }

        /// <summary>
        /// 获取或设置生效开始时间
        /// </summary>
        /// <value>考勤关系的生效开始时间</value>
        [Display(Name = "生效开始时间", Description = "考勤关系的生效开始时间", GroupName = "时间设置")]
        [Required(ErrorMessage = "生效开始时间不能为空")]
        public DateTime EffectiveStartDate { get; set; }

        /// <summary>
        /// 获取或设置生效结束时间
        /// </summary>
        /// <value>考勤关系的生效结束时间，为空表示长期有效</value>
        [Display(Name = "生效结束时间", Description = "考勤关系的生效结束时间，为空表示长期有效", GroupName = "时间设置")]
        public DateTime? EffectiveEndDate { get; set; }

        /// <summary>
        /// 获取或设置是否启用
        /// </summary>
        /// <value>考勤关系是否启用</value>
        [Display(Name = "是否启用", Description = "考勤关系是否启用", GroupName = "基本信息")]
        public bool IsEnabled { get; set; } = true;

        /// <summary>
        /// 获取或设置备注
        /// </summary>
        /// <value>考勤关系的备注信息</value>
        [Display(Name = "备注", Description = "考勤关系的备注信息", GroupName = "基本信息")]
        [MaxLength(512)]
        public string Remark { get; set; }
    }
}
